Nonvolatile memory devices such as Read Only Memory (ROM) units have long been used in microprocessor based systems for storing data which must be repeatedly accessed during program execution. ROM's are advantageous over other memory devices such as a Random Access Memory (RAM), for example, because the contents of a ROM are not lost if the microprocessor system looses electrical power or is turned "off". However, once the ROM has been configured, the data cannot be changed. In many applications it is desirable to store data and thereafter controllably change the stored data. In such instances, a Programmable ROM (PROM), such as an EEPROM, is used. For example, an EEPROM can be used in a vehicle control system for storing calibration data associated with various vehicle sensors. Over time it may be desirable to recalibrate the sensors, due to changes in tolerances, for example. A calibration subroutine can be provided for automatically overwriting the old calibration data in the EEPROM with new, accurate calibration data. However by allowing the data in an EEPROM to be changed, the probability that the stored data will be accidentally overwritten is increased.
In order to reduce the chance of an inadvertent write to the EEPROM, most EEPROMs require the presence of a write-enable signal simultaneous with a write instruction to the EEPROM. This dramatically reduces the likelihood of an inadvertent EEPROM write; but, in some situations, it is still possible for the stored data to be accidentally overwritten. For example, if the program counter becomes lost during program execution, an operand can be mistakenly interpreted as an operation opcode. If the operand corresponds to a write command, the contents of the EEPROM can be overwritten. An inadvertent write of this nature in a vehicle control system could have serious effects on vehicle operation. Therefore, it is desirable to provide extra protection against inadvertent EEPROM writes.
The present invention is directed to overcoming one or more of the above problems by providing a method and apparatus for reducing the likelihood of an inadvertent EEPROM write.